package vn.sunnet.game.SinhTon.global;

import vn.sunnet.game.SinhTon.screen.LoadingScreen;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Polygon;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.utils.Array;

public class Assets {
	// Loading
	public static Texture ttBgLoading;
	public static Texture ttDotLoading;
	public static Texture ttTextLoading;
	public static Texture ttLoadingTask;

	// font
	public static BitmapFont font, font1;

	// Main Menu
	public static Texture ttBgMenu;
	public static Texture ttPlay;
	public static Texture ttPlay_hover;
	public static Array<Texture> arrPlay;
	public static Array<TextureRegion> arrPlay1;

	// Select Map
	public static Texture ttBgSelectMap;
	public static Texture ttBgMapVN;
	public static Texture ttPoint;
	public static Texture ttPoint1;
	public static Texture ttPointHover;

	private static TextureAtlas atlasMapVN;
	public static Array<TextureRegion> trMapVN;

	private static TextureAtlas atlasMap;
	public static Array<AtlasRegion> trMapOption;
	public static Array<AtlasRegion> trMapOptionLock;

	// Stage
	public static Texture ttBgStage;
	public static TextureRegion trLock;
	public static TextureRegion trImage1;
	private static TextureAtlas atlasStageLock;
	public static Array<TextureRegion> trStageLock;

	// -------------------------------------------------PlayScreen-----------------------------------------------------------

	// Texure--------------------------------------------TEXTURE--------------------------------------------------------------
	public static Array<Texture> ttMap;
	private static Array<Texture> straight_Texture;
	private static Array<Texture> incline_Texture;
	private static Array<Texture> atStraight_Texture;
	private static Array<Texture> atIncline_Texture;
	private static Array<Texture> dead_Texture;
	public static Texture wave1;
	public static Texture wave_final;

	public static Texture ttBgWin;

	private static TextureAtlas atlasImage;
	public static Array<TextureRegion> trImage;
	// Khai bao Zombie o trang thai di thang va di cheo
	// ---------------------------------------------TextureRegion----------------------------------------------------------

	public static Texture ttPlusScore;
	public static Texture ttNumber;

	public static Array<TextureRegion> straight1_Region;
	public static Array<TextureRegion> incline1_Region;

	public static Array<TextureRegion> straight2_Region;
	public static Array<TextureRegion> incline2_Region;

	public static Array<TextureRegion> straight3_Region;
	public static Array<TextureRegion> incline3_Region;

	public static Array<TextureRegion> straight4_Region;
	public static Array<TextureRegion> incline4_Region;

	public static Array<TextureRegion> straight5_Region;
	public static Array<TextureRegion> incline5_Region;

	public static Array<TextureRegion> straight6_Region;
	public static Array<TextureRegion> incline6_Region;

	public static Array<TextureRegion> straight7_Region;
	public static Array<TextureRegion> incline7_Region;

	public static Array<TextureRegion> straight8_Region;
	public static Array<TextureRegion> incline8_Region;

	public static Array<TextureRegion> straight9_Region;
	public static Array<TextureRegion> incline9_Region;

	public static Array<TextureRegion> straight10_Region;
	public static Array<TextureRegion> incline10_Region;

	public static Array<TextureRegion> straight11_Region;
	public static Array<TextureRegion> incline11_Region;

	public static Array<TextureRegion> atStraight1_Region;
	public static Array<TextureRegion> atIncline1_Region;

	public static Array<TextureRegion> atStraight2_Region;
	public static Array<TextureRegion> atIncline2_Region;

	public static Array<TextureRegion> atStraight3_Region;
	public static Array<TextureRegion> atIncline3_Region;

	public static Array<TextureRegion> atStraight4_Region;
	public static Array<TextureRegion> atIncline4_Region;

	public static Array<TextureRegion> atStraight5_Region;
	public static Array<TextureRegion> atIncline5_Region;

	public static Array<TextureRegion> atStraight6_Region;
	public static Array<TextureRegion> atIncline6_Region;

	public static Array<TextureRegion> atStraight7_Region;
	public static Array<TextureRegion> atIncline7_Region;

	public static Array<TextureRegion> atStraight8_Region;
	public static Array<TextureRegion> atIncline8_Region;

	public static Array<TextureRegion> atStraight9_Region;
	public static Array<TextureRegion> atIncline9_Region;

	public static Array<TextureRegion> atStraight10_Region;
	public static Array<TextureRegion> atIncline10_Region;

	public static Array<TextureRegion> atStraight11_Region;
	public static Array<TextureRegion> atIncline11_Region;

	public static Array<TextureRegion> dead1_Region;
	public static Array<TextureRegion> dead2_Region;
	public static Array<TextureRegion> dead3_Region;
	public static Array<TextureRegion> dead4_Region;
	public static Array<TextureRegion> dead5_Region;
	public static Array<TextureRegion> dead6_Region;
	public static Array<TextureRegion> dead7_Region;
	public static Array<TextureRegion> dead8_Region;
	public static Array<TextureRegion> dead9_Region;
	public static Array<TextureRegion> dead10_Region;
	public static Array<TextureRegion> dead11_Region;

	// Boss
	private static TextureAtlas atlasBoss;
	public static Array<AtlasRegion> trBoss11Move;
	public static Array<AtlasRegion> trBoss10Move;
	public static Array<AtlasRegion> trNipper;
	public static Array<AtlasRegion> trNipperDie;
	public static TextureRegion trBoss11Die;
	public static TextureRegion trBoss10Die;
	public static TextureRegion trBulletBoss;

	// ---------------------------------------------------------------------------------------------------

	private static TextureAtlas atlasItem;
	public static Array<AtlasRegion> actor_Region;

	// skill
	private static TextureAtlas atlasSkill;
	public static Array<TextureRegion> trSkillGame;
	public static Array<TextureRegion> trSkillImage;
	private static Array<TextureRegion> trSkillAnimation;

	public static Array<TextureRegion> trSkillRocket;
	public static Array<TextureRegion> trSkillFreeze;
	public static Array<TextureRegion> trSkillLuuDan;

	private static Array<Texture> arrFire;
	public static Array<TextureRegion> trFire1;
	public static Array<TextureRegion> trFire2;
	public static Array<TextureRegion> trFire3;

	public static Texture ttBgFreeze;
	// sung dan
	private static TextureAtlas gunBullet_Atlas;
	public static Array<TextureRegion> gun_Region, bullet_Region, trung_Region,
			trGunOption;

	// Blockhouse - locot
	private static TextureAtlas blockhouse_Atlas;
	public static Array<TextureRegion> blockhouse_Region;

	// -----------------------------------------------------SHOP-----------------------------------------------------
	private static TextureAtlas atlasGun;
	public static Array<AtlasRegion> trSung;
	public static Array<AtlasRegion> trGun;
	public static Array<AtlasRegion> trGun_hover;
	public static Array<AtlasRegion> trSkill;
	public static Array<AtlasRegion> trSkill_hover;

	private static TextureAtlas atlasLocot;
	public static Array<AtlasRegion> trLocot;
	public static Array<AtlasRegion> trBlockhouse;
	public static Array<AtlasRegion> trBlockhouse_hover;

	// Bien
	// boolean--------------------------------------BOOLEAN------------------------------------------------------------
	public static boolean LOAD_ASSETS;
	public static boolean LOADING;
	public static boolean GET_MAINMENU;
	public static boolean GET_SELECTMAP;
	public static boolean GET_STAGE;
	public static boolean GET_SHOP;
	public static boolean GET_BUTTON;
	public static boolean GET_PLAY;

	public static boolean IS_GAMEOVER;
	public static boolean IS_GAMEWIN;

	// Cac bien kiem tra da mua skill hay chua
	public static boolean isBuyRocket; // Rocket
	public static boolean isBuyFreeze; // Đóng băng
	public static boolean isBuyGnerade; // Lựu đạn
	// Cac bien kiem tra da mua sung chua
	public static boolean isBuyGun2;
	public static boolean isBuyGun3;
	public static boolean isBuyGun4;
	public static boolean isBuyGun5;
	public static boolean isBuyGun6;

	// Bien
	// int------------------------------------------INT----------------------------------------------------------------
	public static int SCREEN_WIDTH = 800;
	public static int SCREEN_HEIGHT = 480;

	public static int map = 1;
	public static int stage = 1;

	public static int score = 0;
	public static int coin = Setting.getCoin();
	public static int MAX_MAP = 10;
	public static int MAX_STAGE = 6;

	public static Polygon polygonLocot;
	// Animation
	public static Animation animationMove;
	public static Animation animationAttack;
	public static Animation animationDie;

	public static Animation atBoss11, atBoss10, atNipperLeft, atNipperDie;

	// -------------------------------------------------------------SHOP-------------------------------------------------------
	public static Texture ttBar;
	public static Texture ttBgShopGun;
	public static Texture ttBgShopSkill;
	public static Texture ttBought;
	public static Texture ttNotEnoughCoin;

	public static Skin skin;
	public static ParticleEffect effectStar;
	public static ParticleEffect effectStar1;

	public static TextureRegion trTiepTuc;

	public static Music mLoading;
	public static Music mMainMenu;
	public static Music mOptionShop;
	public static Array<Music> arrMusicGamePlay;
	public static Music mMeetBoss;

	public static Array<Sound> arrSoundGamePlay;
	public static Array<Sound> arrSoundGun;
	public static Array<Sound> arrSoundZombie;
	public static Array<Sound> arrSoundInShop;
	public static Sound sClick;

	public static void loadingAsset() {
		Texture.setEnforcePotImages(false);
		ttBgLoading = loadTexture("loading/bgLoading.png");
		ttDotLoading = loadTexture("loading/dotLoading.png");
		ttLoadingTask = loadTexture("loading/loadingTask.png");
		mLoading = Gdx.audio.newMusic(Gdx.files.internal("music/mLoading.mp3"));
		mLoading.setLooping(true);
		LOADING = true;
	}

	public static void disposeObjects() {
		if (LoadingScreen.manager != null)
			LoadingScreen.manager.clear();
		if (LoadingScreen.managerMusic != null)
			LoadingScreen.managerMusic.clear();
		if (effectStar != null)
			effectStar.dispose();
		if (effectStar1 != null)
			effectStar1.dispose();
		if (skin != null)
			skin.dispose();
		animationMove = null;
		animationAttack = null;
		animationDie = null;
		atBoss11 = null;
		atBoss10 = null;
		atNipperLeft = null;
		atNipperDie = null;
		arrPlay = null;
		arrPlay1 = null;

		atlasGun = null;
		atlasImage = null;
		atlasItem = null;
		atlasBoss = null;
		atlasMap = null;
		atlasMapVN = null;
		atlasSkill = null;
		atlasStageLock = null;

		trMapVN = null;
		trMapOption = null;
		trMapOptionLock = null;
		trStageLock = null;
		ttMap = null;
		straight_Texture = null;
		incline_Texture = null;
		atStraight_Texture = null;
		atIncline_Texture = null;
		dead_Texture = null;

		trImage1 = null;
		trLock = null;

		trImage = null;

		straight_Texture = null;

		straight1_Region = null;
		straight2_Region = null;
		straight3_Region = null;
		straight4_Region = null;
		straight5_Region = null;
		straight6_Region = null;
		straight7_Region = null;
		straight8_Region = null;
		straight9_Region = null;
		straight10_Region = null;
		straight11_Region = null;

		incline1_Region = null;
		incline2_Region = null;
		incline3_Region = null;
		incline4_Region = null;
		incline5_Region = null;
		incline6_Region = null;
		incline7_Region = null;
		incline8_Region = null;
		incline9_Region = null;
		incline10_Region = null;
		incline11_Region = null;

		atStraight1_Region = null;
		atIncline1_Region = null;

		atStraight2_Region = null;
		atIncline2_Region = null;

		atStraight3_Region = null;
		atIncline3_Region = null;

		atStraight4_Region = null;
		atIncline4_Region = null;

		atStraight5_Region = null;
		atIncline5_Region = null;

		atStraight6_Region = null;
		atIncline6_Region = null;

		atStraight7_Region = null;
		atIncline7_Region = null;

		atStraight8_Region = null;
		atIncline8_Region = null;

		atStraight9_Region = null;
		atIncline9_Region = null;
		atStraight10_Region = null;
		atStraight11_Region = null;

		incline_Texture = null;

		dead1_Region = null;
		dead2_Region = null;
		dead3_Region = null;
		dead4_Region = null;
		dead5_Region = null;
		dead6_Region = null;
		dead7_Region = null;
		dead8_Region = null;
		dead9_Region = null;
		dead10_Region = null;
		dead11_Region = null;

		trBoss11Move = null;
		trBoss10Move = null;
		trNipper = null;
		trNipperDie = null;

		actor_Region = null;

		trSkillGame = null;
		trSkillImage = null;
		trSkillAnimation = null;

		trSkillRocket = null;
		trSkillFreeze = null;
		trSkillLuuDan = null;

		arrFire = null;
		trFire1 = null;
		trFire2 = null;
		trFire3 = null;

		trSung = null;
		trGun = null;
		trGun_hover = null;
		trSkill = null;
		trSkill_hover = null;

		trLocot = null;
		trBlockhouse = null;
		trBlockhouse_hover = null;

		gun_Region = null;
		bullet_Region = null;
		trung_Region = null;
		trGunOption = null;
		blockhouse_Region = null;
		if (font != null)
			font.dispose();
		if (font1 != null)
			font1.dispose();

		if (mLoading != null)
			mLoading.dispose();
		if (mMainMenu != null)
			mMainMenu.dispose();
		if (mOptionShop != null)
			mOptionShop.dispose();
		if (mMeetBoss != null)
			mMeetBoss.dispose();
		if (sClick != null)
			sClick.dispose();
		if (arrMusicGamePlay != null)
			for (int i = 0; i < arrMusicGamePlay.size; i++) {
				arrMusicGamePlay.get(i).dispose();
			}
		if (arrSoundGamePlay != null)
			for (int i = 0; i < arrSoundGamePlay.size; i++) {
				arrSoundGamePlay.get(i).dispose();
			}
		if (arrSoundGun != null)
			for (int i = 0; i < arrSoundGun.size; i++) {
				arrSoundGun.get(i).dispose();
			}
		if (arrSoundZombie != null)
			for (int i = 0; i < arrSoundZombie.size; i++) {
				arrSoundZombie.get(i).dispose();
			}
		if (arrSoundInShop != null)
			for (int i = 0; i < arrSoundInShop.size; i++) {
				arrSoundInShop.get(i).dispose();
			}

		LOADING = false;
		GET_MAINMENU = false;
		GET_SELECTMAP = false;

		GET_STAGE = false;
		GET_SHOP = false;
		GET_BUTTON = false;
		GET_PLAY = false;

	}

	public static void getMainMenu() {
		ttBgMenu = getTexture("menu/bgMenu.png");
		ttPlay = getTexture("menu/play.png");
		ttPlay_hover = getTexture("menu/play_hover.png");

		arrPlay = new Array<Texture>();
		arrPlay.add(getTexture("menu/v1.png"));
		arrPlay.add(getTexture("menu/v2.png"));
		arrPlay1 = new Array<TextureRegion>();
		for (int i = 0; i < 2; i++) {
			arrPlay1.add(new TextureRegion(arrPlay.get(i)));
		}

		effectStar = new ParticleEffect();
		effectStar.load(Gdx.files.internal("effect/e1.p"),
				Gdx.files.internal("effect/"));
		// effectStar = LoadingScreen.manager.get("effect/particle.pex");
		effectStar.setPosition(438, 80);

		mMainMenu = getMusic("music/mMainMenu.mp3");
		mMainMenu.setLooping(true);
		mMainMenu.setVolume(1f);

		// sClick = getSound("music/sClick.mp3");

		GET_MAINMENU = true;
	}

	public static void getSelectMap() {
		ttBgSelectMap = getTexture("selectMap/bgSelectMap.png");
		ttBgMapVN = getTexture("selectMap/mapVN.png");
		ttPoint = getTexture("selectMap/point.png");
		ttPoint1 = getTexture("selectMap/point1.png");

		atlasMapVN = getTextureAtlas("TexturePacker/location.pack");
		trMapVN = new Array<TextureRegion>();

		trMapVN.add(atlasMapVN.findRegion("DienBien")); // 0
		trMapVN.add(atlasMapVN.findRegion("HaNoi")); // 1
		trMapVN.add(atlasMapVN.findRegion("Vinh")); // 2
		trMapVN.add(atlasMapVN.findRegion("HaTinh")); // 3
		trMapVN.add(atlasMapVN.findRegion("QuangBinh")); // 4
		trMapVN.add(atlasMapVN.findRegion("Hue")); // 5
		trMapVN.add(atlasMapVN.findRegion("DaNang")); // 6
		trMapVN.add(atlasMapVN.findRegion("NhaTrang")); // 7
		trMapVN.add(atlasMapVN.findRegion("HoChiMinh")); // 8
		trMapVN.add(atlasMapVN.findRegion("CaMau")); // 9

		atlasMap = getTextureAtlas("TexturePacker/map.pack");
		trMapOption = new Array<AtlasRegion>();

		trMapOption.add(atlasMap.findRegion("m1"));
		trMapOption.add(atlasMap.findRegion("m2"));
		trMapOption.add(atlasMap.findRegion("m3"));
		trMapOption.add(atlasMap.findRegion("m4"));
		trMapOption.add(atlasMap.findRegion("m5"));
		trMapOption.add(atlasMap.findRegion("m6"));
		trMapOption.add(atlasMap.findRegion("m7"));
		trMapOption.add(atlasMap.findRegion("m8"));
		trMapOption.add(atlasMap.findRegion("m9"));
		trMapOption.add(atlasMap.findRegion("m10"));

		trMapOptionLock = new Array<AtlasRegion>();

		trMapOptionLock.add(atlasMap.findRegion("l1"));
		trMapOptionLock.add(atlasMap.findRegion("l2"));
		trMapOptionLock.add(atlasMap.findRegion("l3"));
		trMapOptionLock.add(atlasMap.findRegion("l4"));
		trMapOptionLock.add(atlasMap.findRegion("l5"));
		trMapOptionLock.add(atlasMap.findRegion("l6"));
		trMapOptionLock.add(atlasMap.findRegion("l7"));
		trMapOptionLock.add(atlasMap.findRegion("l8"));
		trMapOptionLock.add(atlasMap.findRegion("l9"));
		trMapOptionLock.add(atlasMap.findRegion("l10"));
		trMapOptionLock.add(atlasMap.findRegion("l1"));

		mOptionShop = getMusic("music/mOptionShop.mp3");
		mOptionShop.setLooping(true);
		mOptionShop.setVolume(1);
		GET_SELECTMAP = true;
	}

	public static void getStage() {
		ttBgStage = getTexture("stage/bgStage.png");

		atlasStageLock = getTextureAtlas("TexturePacker/lockStage.pack");
		trStageLock = new Array<TextureRegion>();

		trStageLock.add(atlasStageLock.findRegion("m1"));
		trStageLock.add(atlasStageLock.findRegion("m2"));
		trStageLock.add(atlasStageLock.findRegion("m3"));
		trStageLock.add(atlasStageLock.findRegion("m4"));
		trStageLock.add(atlasStageLock.findRegion("m5"));
		trStageLock.add(atlasStageLock.findRegion("m6"));

		trLock = atlasStageLock.findRegion("lock");
		trImage1 = atlasStageLock.findRegion("image");

		GET_STAGE = true;
	}

	private static void getSkill() {
		// skill
		atlasSkill = getTextureAtlas("TexturePacker/skill.pack");

		trSkillGame = new Array<TextureRegion>();
		trSkillGame.add(atlasSkill.findRegion("rocket")); // 0
		trSkillGame.add(atlasSkill.findRegion("freeze")); // 1
		trSkillGame.add(atlasSkill.findRegion("luuDan")); // 2

		trSkillImage = new Array<TextureRegion>();
		trSkillAnimation = new Array<TextureRegion>();

		trSkillImage.add(atlasSkill.findRegion("imageRocket"));
		trSkillImage.add(atlasSkill.findRegion("imageFreeze"));
		trSkillImage.add(atlasSkill.findRegion("imageLuuDan"));

		trSkillAnimation.add(atlasSkill.findRegion("skillRocket"));
		trSkillAnimation.add(atlasSkill.findRegion("skillFreeze"));
		trSkillAnimation.add(atlasSkill.findRegion("skillLuuDan"));

		trSkillRocket = new Array<TextureRegion>();
		trSkillFreeze = new Array<TextureRegion>();
		trSkillLuuDan = new Array<TextureRegion>();

		// Cat cac TextureRegion ra thanh cac animation
		trSkillRocket = split(trSkillAnimation.get(0), 110, 110);
		trSkillFreeze = split(trSkillAnimation.get(1), 110, 109);
		trSkillLuuDan = split(trSkillAnimation.get(2), 110, 110);

		arrFire = new Array<Texture>();
		arrFire.add(getTexture("play/skill/fire1.png"));
		arrFire.add(getTexture("play/skill/fire2.png"));
		arrFire.add(getTexture("play/skill/fire3.png"));

		trFire1 = new Array<TextureRegion>();
		trFire2 = new Array<TextureRegion>();
		trFire3 = new Array<TextureRegion>();

		trFire1 = splitTexture(arrFire.get(0), 3, 101, 303);
		trFire2 = splitTexture(arrFire.get(1), 8, 235, 235);
		trFire3 = splitTexture(arrFire.get(2), 6, 125, 124);

		ttBgFreeze = getTexture("play/skill/bgFreeze.png");
	}

	private static void getMusicSoundGamePlay() {
		arrMusicGamePlay = new Array<Music>();
		arrMusicGamePlay.add(getMusic("music/musicGame1.mp3"));
		arrMusicGamePlay.add(getMusic("music/musicGame2.mp3"));
		arrMusicGamePlay.add(getMusic("music/musicGame3.mp3"));
		arrMusicGamePlay.add(getMusic("music/musicGame4.mp3"));
		for (int i = 0; i < 4; i++) {
			arrMusicGamePlay.get(i).setLooping(true);
			arrMusicGamePlay.get(i).setVolume(1);
		}

		mMeetBoss = getMusic("music/musicGapBoss.mp3");
		mMeetBoss.setLooping(true);
		mMeetBoss.setVolume(1);

		arrSoundGamePlay = new Array<Sound>();
		arrSoundGamePlay.add(getSound("music/sBanVaoTuong.mp3")); // 0 ban vao
																	// tuong
		arrSoundGamePlay.add(getSound("music/sBiTanCong.mp3")); // 1 bi tan cong
		arrSoundGamePlay.add(getSound("music/sDoiSung.mp3")); // 2

		arrSoundGamePlay.add(getSound("music/sGunCanonNo.mp3")); // 3
		arrSoundGamePlay.add(getSound("music/sNoSkillLuuDan.mp3")); // 4
		arrSoundGamePlay.add(getSound("music/sNoSkillRocket.mp3")); // 5
		arrSoundGamePlay.add(getSound("music/sPressSkillFreeze.mp3")); // 6

		arrSoundGamePlay.add(getSound("music/sSkillFreeze.mp3")); // 7
		arrSoundGamePlay.add(getSound("music/sSkillLuuDan.mp3")); // 8
		arrSoundGamePlay.add(getSound("music/sSkillRocket.mp3")); // 9
		arrSoundGamePlay.add(getSound("music/sTrungZombie.mp3")); // 10 ban
																	// trung
																	// zombie
		arrSoundGamePlay.add(getSound("music/sGameOver.mp3")); // 11 Nhac thua
		arrSoundGamePlay.add(getSound("music/sGameWin.mp3")); // 12 Nhac thang

		arrSoundGun = new Array<Sound>();
		arrSoundGun.add(getSound("music/sGun1.mp3")); // 0 sung1
		arrSoundGun.add(getSound("music/sGun2.mp3")); // 1 sung 2
		arrSoundGun.add(getSound("music/sGun3.mp3")); // 2 sung 3
		arrSoundGun.add(getSound("music/sGun4.mp3")); // 3 sung 4
		arrSoundGun.add(getSound("music/sGun5.mp3")); // 4 sung 5
		arrSoundGun.add(getSound("music/sGun6.mp3")); // 5 sung 6

		arrSoundZombie = new Array<Sound>();
		arrSoundZombie.add(getSound("music/sZombie1.mp3")); // 0
		arrSoundZombie.add(getSound("music/sZombie2.mp3")); // 1
		arrSoundZombie.add(getSound("music/sZombie3.mp3")); // 2
		arrSoundZombie.add(getSound("music/sZombie4.mp3")); // 3
		arrSoundZombie.add(getSound("music/sZombie5.mp3")); // 4
		arrSoundZombie.add(getSound("music/sZombie6.mp3")); // 5
	}

	private static void getItem() {
		atlasImage = getTextureAtlas("TexturePacker/image.pack");
		trImage = new Array<TextureRegion>();

		trImage.add(atlasImage.findRegion("bgDialogPause")); // 0 dialog Pause
		trImage.add(atlasImage.findRegion("bgDialogLose")); // 1 dialog Lose
		trImage.add(atlasImage.findRegion("bgDialogWin")); // 2 dialog Win

		trImage.add(atlasImage.findRegion("chien")); // 3 chữ chiến
		trImage.add(atlasImage.findRegion("thang")); // 4 chữ thắng
		trImage.add(atlasImage.findRegion("thatBai")); // 5 chữ thất bại

		trImage.add(atlasImage.findRegion("barBottom")); // 6 khung
		trImage.add(atlasImage.findRegion("bgBlood")); // 7 bg mau
		trImage.add(atlasImage.findRegion("blood")); // 8 mau

		trImage.add(atlasImage.findRegion("bar")); // 9 bar
		trImage.add(atlasImage.findRegion("bar1")); // 10 bar1
		trImage.add(atlasImage.findRegion("kim")); // 11 kim
		trImage.add(atlasImage.findRegion("lock")); // 12 lock
		trImage.add(atlasImage.findRegion("bgGold")); // 13 gold
		trImage.add(atlasImage.findRegion("diem")); // 14 điem
		trImage.add(atlasImage.findRegion("barSkill")); // 15
		trImage.add(atlasImage.findRegion("bgLoseLeft")); // 16
		trImage.add(atlasImage.findRegion("bgLoseRight")); // 17

		atlasItem = LoadingScreen.manager.get("TexturePacker/NhanVat.pack",
				TextureAtlas.class);

		actor_Region = new Array<AtlasRegion>();
		actor_Region.add(atlasItem.findRegion("11"));
		actor_Region.add(atlasItem.findRegion("21"));
		actor_Region.add(atlasItem.findRegion("31"));
		actor_Region.add(atlasItem.findRegion("41"));
		actor_Region.add(atlasItem.findRegion("51"));
		actor_Region.add(atlasItem.findRegion("61"));

		ttMap = new Array<Texture>();
		ttMap.add(getTexture("play/bgMap/bgMap1.png"));
		ttMap.add(getTexture("play/bgMap/bgMap2.png"));
		ttMap.add(getTexture("play/bgMap/bgMap3.png"));
		ttMap.add(getTexture("play/bgMap/bgMap4.png"));
		ttMap.add(getTexture("play/bgMap/bgMap5.png"));
		ttMap.add(getTexture("play/bgMap/bgMap6.png"));
		ttMap.add(getTexture("play/bgMap/bgMap7.png"));
		ttMap.add(getTexture("play/bgMap/bgMap8.png"));
		ttMap.add(getTexture("play/bgMap/bgMap9.png"));
		ttMap.add(getTexture("play/bgMap/bgMap10.png"));

		ttPlusScore = getTexture("play/item/plus.png");
		ttNumber = getTexture("play/item/number.png");

		ttBgWin = getTexture("play/item/bgWin.png");

		effectStar1 = new ParticleEffect();
		effectStar1.load(Gdx.files.internal("effect/star1.p"),
				Gdx.files.internal("effect/"));
		effectStar1.setPosition(380, 293);
	}

	public static void getButton() {
		skin = LoadingScreen.manager.get("skin/button.json");
		trTiepTuc = skin.getRegion("tiepTuc");
		sClick = getSound("music/sClick.mp3");
		font = new BitmapFont(Gdx.files.internal("font/font.fnt"),
				Gdx.files.internal("font/font.png"), false);
		font.getRegion().getTexture()
				.setFilter(TextureFilter.Linear, TextureFilter.Linear);
		font1 = new BitmapFont(Gdx.files.internal("font/font1.fnt"),
				Gdx.files.internal("font/font1.png"), false);
		font1.getRegion().getTexture()
				.setFilter(TextureFilter.Linear, TextureFilter.Linear);
		GET_BUTTON = true;
	}

	public static void getPlay() {
		wave1 = getTexture("play/item/wave1.png");
		wave_final = getTexture("play/item/wave_end.png");
		getArrRegionZombie();
		getItem();
		// sung dan - Locot
		getGunBulletBlockhouse();
		// blockhouse - locot
		getSkill();
		getMusicSoundGamePlay();
		getBoss();
		polygonLocot = new Polygon(new float[] { 255, 35, 372, 100, 408, 97,
				500, 22});
		GET_PLAY = true;
	}

	private static void getBoss() {
		atlasBoss = getTextureAtlas("TexturePacker/boss.pack");

		trBoss11Move = new Array<TextureAtlas.AtlasRegion>();
		trBoss11Move.add(atlasBoss.findRegion("boss11Move1"));
		trBoss11Move.add(atlasBoss.findRegion("boss11Move2"));
		trBoss11Move.add(atlasBoss.findRegion("boss11Move3"));
		trBoss11Move.add(atlasBoss.findRegion("boss11Move4"));
		trBoss11Move.add(atlasBoss.findRegion("boss11Move5"));
		trBoss11Move.add(atlasBoss.findRegion("boss11Move6"));
		trBoss11Move.add(atlasBoss.findRegion("boss11Move7"));
		trBoss11Move.add(atlasBoss.findRegion("boss11Move8"));

		atBoss11 = new Animation(0.1f, trBoss11Move);

		trBoss10Move = new Array<TextureAtlas.AtlasRegion>();
		trBoss10Move.add(atlasBoss.findRegion("boss10Move1"));
		trBoss10Move.add(atlasBoss.findRegion("boss10Move2"));
		trBoss10Move.add(atlasBoss.findRegion("boss10Move3"));
		trBoss10Move.add(atlasBoss.findRegion("boss10Move4"));
		trBoss10Move.add(atlasBoss.findRegion("boss10Move5"));
		trBoss10Move.add(atlasBoss.findRegion("boss10Move6"));

		atBoss10 = new Animation(0.1f, trBoss10Move);

		trNipper = new Array<TextureAtlas.AtlasRegion>();
		trNipper.add(atlasBoss.findRegion("1"));
		trNipper.add(atlasBoss.findRegion("2"));
		trNipper.add(atlasBoss.findRegion("3"));
		trNipper.add(atlasBoss.findRegion("4"));
		trNipper.add(atlasBoss.findRegion("5"));
		trNipper.add(atlasBoss.findRegion("6"));
		trNipper.add(atlasBoss.findRegion("7"));

		atNipperLeft = new Animation(0.1f, trNipper);

		trNipperDie = new Array<TextureAtlas.AtlasRegion>();
		trNipperDie.add(atlasBoss.findRegion("8"));
		trNipperDie.add(atlasBoss.findRegion("9"));
		trNipperDie.add(atlasBoss.findRegion("10"));
		trNipperDie.add(atlasBoss.findRegion("11"));
		trNipperDie.add(atlasBoss.findRegion("12"));
		trNipperDie.add(atlasBoss.findRegion("13"));
		trNipperDie.add(atlasBoss.findRegion("14"));

		atNipperDie = new Animation(0.1f, trNipperDie);

		trBulletBoss = atlasBoss.findRegion("bulletBoss");
		trBoss11Die = atlasBoss.findRegion("boss11MoveDie");
		trBoss10Die = atlasBoss.findRegion("boss10Die");
	}

	public static void getShop() {
		ttBar = getTexture("play/shop/bar.png");
		ttBgShopGun = getTexture("play/shop/bgShopGun.png");
		ttBgShopSkill = getTexture("play/shop/bgShopSkill.png");
		ttBought = getTexture("play/shop/bought.png");
		ttNotEnoughCoin = getTexture("play/shop/popup_not_enough_xu.png");

		atlasGun = getTextureAtlas("TexturePacker/GunSkill.pack");
		trGun = new Array<AtlasRegion>();
		trGun_hover = new Array<AtlasRegion>();
		trSung = new Array<AtlasRegion>();
		trSkill = new Array<AtlasRegion>();
		trSkill_hover = new Array<AtlasRegion>();

		trSung.add(atlasGun.findRegion("sung1"));
		trSung.add(atlasGun.findRegion("sung2"));
		trSung.add(atlasGun.findRegion("sung3"));
		trSung.add(atlasGun.findRegion("sung4"));
		trSung.add(atlasGun.findRegion("sung5"));
		trSung.add(atlasGun.findRegion("sung6"));

		trGun.add(atlasGun.findRegion("gun1"));
		trGun.add(atlasGun.findRegion("gun2"));
		trGun.add(atlasGun.findRegion("gun3"));
		trGun.add(atlasGun.findRegion("gun4"));
		trGun.add(atlasGun.findRegion("gun5"));
		trGun.add(atlasGun.findRegion("gun6"));

		trGun_hover.add(atlasGun.findRegion("gun1_hover"));
		trGun_hover.add(atlasGun.findRegion("gun2_hover"));
		trGun_hover.add(atlasGun.findRegion("gun3_hover"));
		trGun_hover.add(atlasGun.findRegion("gun4_hover"));
		trGun_hover.add(atlasGun.findRegion("gun5_hover"));
		trGun_hover.add(atlasGun.findRegion("gun6_hover"));

		trSkill.add(atlasGun.findRegion("rocket"));
		trSkill.add(atlasGun.findRegion("freeze"));
		trSkill.add(atlasGun.findRegion("luuDan"));

		trSkill_hover.add(atlasGun.findRegion("rocket_hover"));
		trSkill_hover.add(atlasGun.findRegion("freeze_hover"));
		trSkill_hover.add(atlasGun.findRegion("luuDan_hover"));

		atlasLocot = getTextureAtlas("TexturePacker/locot.pack");
		trLocot = new Array<AtlasRegion>();
		trLocot.add(atlasLocot.findRegion("lo1"));
		trLocot.add(atlasLocot.findRegion("lo2"));
		trLocot.add(atlasLocot.findRegion("lo3"));
		trLocot.add(atlasLocot.findRegion("lo4"));
		trLocot.add(atlasLocot.findRegion("lo5"));
		trLocot.add(atlasLocot.findRegion("lo6"));

		trBlockhouse = new Array<AtlasRegion>();
		trBlockhouse.add(atlasLocot.findRegion("l2"));
		trBlockhouse.add(atlasLocot.findRegion("l3"));
		trBlockhouse.add(atlasLocot.findRegion("l4"));
		trBlockhouse.add(atlasLocot.findRegion("l5"));
		trBlockhouse.add(atlasLocot.findRegion("l6"));

		trBlockhouse_hover = new Array<AtlasRegion>();
		trBlockhouse_hover.add(atlasLocot.findRegion("l2_hover"));
		trBlockhouse_hover.add(atlasLocot.findRegion("l3_hover"));
		trBlockhouse_hover.add(atlasLocot.findRegion("l4_hover"));
		trBlockhouse_hover.add(atlasLocot.findRegion("l5_hover"));
		trBlockhouse_hover.add(atlasLocot.findRegion("l6_hover"));

		arrSoundInShop = new Array<Sound>();
		arrSoundInShop.add(getSound("music/sMuaLocot.mp3")); // 0 nút
		arrSoundInShop.add(getSound("music/sMuaSkill.mp3")); // 1
		arrSoundInShop.add(getSound("music/sMuaSung.mp3")); // 2
		arrSoundInShop.add(getSound("music/sNapXu.mp3")); // 3
		arrSoundInShop.add(getSound("music/sSuDung.mp3")); // 4 su dung

		GET_SHOP = true;
	}

	private static void getGunBulletBlockhouse() {
		// Gun- Bullet
		gunBullet_Atlas = getTextureAtlas("TexturePacker/SungDan.pack");
		gun_Region = new Array<TextureRegion>();

		gun_Region.add(gunBullet_Atlas.findRegion("gun1"));
		gun_Region.add(gunBullet_Atlas.findRegion("gun2"));
		gun_Region.add(gunBullet_Atlas.findRegion("gun3"));
		gun_Region.add(gunBullet_Atlas.findRegion("gun4"));
		gun_Region.add(gunBullet_Atlas.findRegion("gun5"));
		gun_Region.add(gunBullet_Atlas.findRegion("gun6"));

		bullet_Region = new Array<TextureRegion>();
		bullet_Region.add(gunBullet_Atlas.findRegion("dan1"));
		bullet_Region.add(gunBullet_Atlas.findRegion("dan2"));
		bullet_Region.add(gunBullet_Atlas.findRegion("dan3"));
		bullet_Region.add(gunBullet_Atlas.findRegion("dan4"));
		bullet_Region.add(gunBullet_Atlas.findRegion("dan5"));
		bullet_Region.add(gunBullet_Atlas.findRegion("dan6"));

		trung_Region = new Array<TextureRegion>();
		trung_Region.add(gunBullet_Atlas.findRegion("trung1"));
		trung_Region.add(gunBullet_Atlas.findRegion("trung2"));
		trung_Region.add(gunBullet_Atlas.findRegion("trung3"));
		trung_Region.add(gunBullet_Atlas.findRegion("trung4"));
		trung_Region.add(gunBullet_Atlas.findRegion("trung5"));
		trung_Region.add(gunBullet_Atlas.findRegion("trung6"));

		trGunOption = new Array<TextureRegion>();
		trGunOption.add(gunBullet_Atlas.findRegion("sung1"));
		trGunOption.add(gunBullet_Atlas.findRegion("sung2"));
		trGunOption.add(gunBullet_Atlas.findRegion("sung3"));
		trGunOption.add(gunBullet_Atlas.findRegion("sung4"));
		trGunOption.add(gunBullet_Atlas.findRegion("sung5"));
		trGunOption.add(gunBullet_Atlas.findRegion("sung6"));

		blockhouse_Atlas = getTextureAtlas("TexturePacker/locot.pack");
		blockhouse_Region = new Array<TextureRegion>();
		blockhouse_Region.add(blockhouse_Atlas.findRegion("lo1")); // 0
		blockhouse_Region.add(blockhouse_Atlas.findRegion("lo2"));
		blockhouse_Region.add(blockhouse_Atlas.findRegion("lo3"));
		blockhouse_Region.add(blockhouse_Atlas.findRegion("lo4"));
		blockhouse_Region.add(blockhouse_Atlas.findRegion("lo5"));
		blockhouse_Region.add(blockhouse_Atlas.findRegion("lo6")); // 5

	}

	private static void getArrRegionZombie() {
		straight_Texture = new Array<Texture>();
		straight_Texture.add(getTexture("play/zombie/straight1.png"));
		straight_Texture.add(getTexture("play/zombie/straight2.png"));
		straight_Texture.add(getTexture("play/zombie/straight3.png"));
		straight_Texture.add(getTexture("play/zombie/straight4.png"));
		straight_Texture.add(getTexture("play/zombie/straight5.png"));
		straight_Texture.add(getTexture("play/zombie/straight6.png"));
		straight_Texture.add(getTexture("play/zombie/straight7.png"));
		straight_Texture.add(getTexture("play/zombie/straight8.png"));
		straight_Texture.add(getTexture("play/zombie/straight9.png"));
		straight_Texture.add(getTexture("play/zombie/straight10.png"));
		straight_Texture.add(getTexture("play/zombie/straight11.png"));

		incline_Texture = new Array<Texture>();
		incline_Texture.add(getTexture("play/zombie/incline1.png"));
		incline_Texture.add(getTexture("play/zombie/incline2.png"));
		incline_Texture.add(getTexture("play/zombie/incline3.png"));
		incline_Texture.add(getTexture("play/zombie/incline4.png"));
		incline_Texture.add(getTexture("play/zombie/incline5.png"));
		incline_Texture.add(getTexture("play/zombie/incline6.png"));
		incline_Texture.add(getTexture("play/zombie/incline7.png"));
		incline_Texture.add(getTexture("play/zombie/incline8.png"));
		incline_Texture.add(getTexture("play/zombie/incline9.png"));
		incline_Texture.add(getTexture("play/zombie/incline10.png"));
		incline_Texture.add(getTexture("play/zombie/incline11.png"));

		atIncline_Texture = new Array<Texture>();
		atIncline_Texture.add(getTexture("play/zombie/atIncline1.png"));
		atIncline_Texture.add(getTexture("play/zombie/atIncline2.png"));
		atIncline_Texture.add(getTexture("play/zombie/atIncline3.png"));
		atIncline_Texture.add(getTexture("play/zombie/atIncline4.png"));
		atIncline_Texture.add(getTexture("play/zombie/atIncline5.png"));
		atIncline_Texture.add(getTexture("play/zombie/atIncline6.png"));
		atIncline_Texture.add(getTexture("play/zombie/atIncline7.png"));
		atIncline_Texture.add(getTexture("play/zombie/atIncline8.png"));
		atIncline_Texture.add(getTexture("play/zombie/atIncline9.png"));
		atIncline_Texture.add(getTexture("play/zombie/atIncline10.png"));
		atIncline_Texture.add(getTexture("play/zombie/atIncline11.png"));

		atStraight_Texture = new Array<Texture>();
		atStraight_Texture.add(getTexture("play/zombie/atStraight1.png"));
		atStraight_Texture.add(getTexture("play/zombie/atStraight2.png"));
		atStraight_Texture.add(getTexture("play/zombie/atStraight3.png"));
		atStraight_Texture.add(getTexture("play/zombie/atStraight4.png"));
		atStraight_Texture.add(getTexture("play/zombie/atStraight5.png"));
		atStraight_Texture.add(getTexture("play/zombie/atStraight6.png"));
		atStraight_Texture.add(getTexture("play/zombie/atStraight7.png"));
		atStraight_Texture.add(getTexture("play/zombie/atStraight8.png"));
		atStraight_Texture.add(getTexture("play/zombie/atStraight9.png"));
		atStraight_Texture.add(getTexture("play/zombie/atStraight10.png"));
		atStraight_Texture.add(getTexture("play/zombie/atStraight11.png"));

		dead_Texture = new Array<Texture>();
		dead_Texture.add(getTexture("play/zombie/dead1.png"));
		dead_Texture.add(getTexture("play/zombie/dead2.png"));
		dead_Texture.add(getTexture("play/zombie/dead3.png"));

		straight1_Region = splitTexture(straight_Texture.get(0), 45, 57);
		incline1_Region = splitTexture(incline_Texture.get(0), 48, 59);

		straight2_Region = splitTexture(straight_Texture.get(1), 44, 64);
		incline2_Region = splitTexture(incline_Texture.get(1), 50, 67);

		straight3_Region = splitTexture(straight_Texture.get(2), 46, 63);
		incline3_Region = splitTexture(incline_Texture.get(2), 47, 67);

		straight4_Region = splitTexture(straight_Texture.get(3), 91, 132);
		incline4_Region = splitTexture(incline_Texture.get(3), 93, 131);

		straight5_Region = splitTexture(straight_Texture.get(4), 74, 105);
		incline5_Region = splitTexture(incline_Texture.get(4), 76, 102);

		straight6_Region = splitTexture(straight_Texture.get(5), 62, 94);
		incline6_Region = splitTexture(incline_Texture.get(5), 9, 112, 152);

		straight7_Region = splitTexture(straight_Texture.get(6), 105, 144);
		incline7_Region = splitTexture(incline_Texture.get(6), 9, 64, 87);

		straight8_Region = splitTexture(straight_Texture.get(7), 7, 80, 80);
		incline8_Region = splitTexture(incline_Texture.get(7), 7, 80, 80);

		straight9_Region = splitTexture(straight_Texture.get(8), 7, 80, 80);
		incline9_Region = splitTexture(incline_Texture.get(8), 7, 80, 80);

		straight10_Region = splitTexture(straight_Texture.get(9), 8, 67, 96);
		incline10_Region = splitTexture(incline_Texture.get(9), 8, 106, 100);

		straight11_Region = splitTexture(straight_Texture.get(10), 9, 120, 120);
		incline11_Region = splitTexture(incline_Texture.get(10), 12, 120, 120);

		dead1_Region = splitTexture(dead_Texture.get(0), 9, 140, 140);
		dead2_Region = splitTexture(dead_Texture.get(0), 9, 140, 140);
		dead3_Region = splitTexture(dead_Texture.get(0), 9, 140, 140);

		dead4_Region = splitTexture(dead_Texture.get(1), 7, 140, 140);
		dead5_Region = splitTexture(dead_Texture.get(1), 7, 140, 140);
		dead6_Region = splitTexture(dead_Texture.get(1), 7, 140, 140);

		dead7_Region = splitTexture(dead_Texture.get(2), 11, 140, 140);
		dead8_Region = splitTexture(dead_Texture.get(2), 11, 140, 140);
		dead9_Region = splitTexture(dead_Texture.get(2), 11, 140, 140);
		dead10_Region = splitTexture(dead_Texture.get(2), 11, 140, 140);
		dead11_Region = splitTexture(dead_Texture.get(2), 11, 140, 140);

		atIncline1_Region = splitTexture3(atIncline_Texture.get(0), 80, 80);
		atIncline2_Region = splitTexture3(atIncline_Texture.get(1), 80, 80);
		atIncline3_Region = splitTexture3(atIncline_Texture.get(2), 80, 80);
		atIncline4_Region = splitTexture3(atIncline_Texture.get(3), 80, 80);
		atIncline5_Region = splitTexture3(atIncline_Texture.get(4), 80, 80);
		atIncline6_Region = splitTexture3(atIncline_Texture.get(5), 80, 80);
		atIncline7_Region = splitTexture3(atIncline_Texture.get(6), 80, 80);
		atIncline8_Region = splitTexture3(atIncline_Texture.get(7), 80, 80);
		atIncline9_Region = splitTexture3(atIncline_Texture.get(8), 80, 80);
		atIncline10_Region = splitTexture3(atIncline_Texture.get(9), 60, 60);
		atIncline11_Region = splitTexture3(atIncline_Texture.get(10), 120, 120);

		atStraight1_Region = splitTexture3(atStraight_Texture.get(0), 80, 80);
		atStraight2_Region = splitTexture3(atStraight_Texture.get(1), 80, 80);
		atStraight3_Region = splitTexture3(atStraight_Texture.get(2), 80, 80);
		atStraight4_Region = splitTexture3(atStraight_Texture.get(3), 80, 80);
		atStraight5_Region = splitTexture3(atStraight_Texture.get(4), 80, 80);
		atStraight6_Region = splitTexture3(atStraight_Texture.get(5), 80, 80);
		atStraight7_Region = splitTexture3(atStraight_Texture.get(6), 80, 80);
		atStraight8_Region = splitTexture3(atStraight_Texture.get(7), 80, 80);
		atStraight9_Region = splitTexture3(atStraight_Texture.get(8), 80, 80);
		atStraight10_Region = splitTexture3(atStraight_Texture.get(9), 60, 60);
		atStraight11_Region = splitTexture3(atStraight_Texture.get(10), 120,
				120);

	}

	public static Animation getAnimation(int direct, int id) {
		switch (id) {
		case 1:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight1_Region);
			else
				animationMove = new Animation(0.1f, incline1_Region);
			break;
		case 2:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight2_Region);
			else
				animationMove = new Animation(0.1f, incline2_Region);
			break;
		case 3:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight3_Region);
			else
				animationMove = new Animation(0.1f, incline3_Region);
			break;
		case 4:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight4_Region);
			else
				animationMove = new Animation(0.1f, incline4_Region);
			break;
		case 5:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight5_Region);
			else
				animationMove = new Animation(0.1f, incline5_Region);
			break;
		case 6:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight6_Region);
			else
				animationMove = new Animation(0.1f, incline6_Region);
			break;
		case 7:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight7_Region);
			else
				animationMove = new Animation(0.1f, incline7_Region);
			break;
		case 8:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight8_Region);
			else
				animationMove = new Animation(0.1f, incline8_Region);
			break;
		case 9:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight9_Region);
			else
				animationMove = new Animation(0.1f, incline9_Region);
			break;
		case 10:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight10_Region);
			else
				animationMove = new Animation(0.1f, incline10_Region);
			break;
		case 11:
			if (direct == 2)
				animationMove = new Animation(0.1f, straight11_Region);
			else
				animationMove = new Animation(0.1f, incline11_Region);
			break;
		}
		return animationMove;
	}

	public static Animation getAnimationAttack(int id) {
		switch (id) {
		case 1:
			animationAttack = new Animation(0.1f, atStraight1_Region);
			break;
		case 2:
			animationAttack = new Animation(0.1f, atStraight2_Region);
			break;
		case 3:

			animationAttack = new Animation(0.1f, atStraight3_Region);
			break;
		case 4:
			animationAttack = new Animation(0.1f, atStraight4_Region);
			break;
		case 5:
			animationAttack = new Animation(0.1f, atStraight5_Region);
			break;
		case 6:
			animationAttack = new Animation(0.1f, atStraight7_Region);
			break;
		case 7:
			animationAttack = new Animation(0.1f, atStraight8_Region);
			break;
		case 8:
			animationAttack = new Animation(0.1f, atStraight8_Region);
			break;
		case 9:
			animationAttack = new Animation(0.1f, atStraight9_Region);
			break;
		}
		return animationAttack;
	}

	public static Animation getAnimationAttack(int direct, int id) {
		switch (id) {
		case 1:
			if (direct == 2)
				animationAttack = new Animation(0.1f, atStraight1_Region);
			else
				animationAttack = new Animation(0.1f, atIncline1_Region);
			break;
		case 2:
			if (direct == 2)
				animationAttack = new Animation(0.1f, atStraight2_Region);
			else
				animationAttack = new Animation(0.1f, atIncline2_Region);
			break;
		case 3:
			if (direct == 2)
				animationAttack = new Animation(0.1f, atStraight3_Region);
			else
				animationAttack = new Animation(0.1f, atIncline3_Region);
			break;
		case 4:
			if (direct == 2)
				animationAttack = new Animation(0.1f, atStraight4_Region);
			else
				animationAttack = new Animation(0.1f, atIncline4_Region);
			break;
		case 5:
			if (direct == 2)
				animationAttack = new Animation(0.1f, atStraight5_Region);
			else
				animationAttack = new Animation(0.1f, atIncline5_Region);
			break;
		case 6:
			if (direct == 2)
				animationAttack = new Animation(0.1f, atStraight7_Region);
			else
				animationAttack = new Animation(0.1f, atIncline7_Region);
			break;
		case 7:
			if (direct == 2)
				animationAttack = new Animation(0.1f, atStraight8_Region);
			else
				animationAttack = new Animation(0.1f, atIncline8_Region);
			break;
		case 8:
			if (direct == 2)
				animationAttack = new Animation(0.1f, atStraight8_Region);
			else
				animationAttack = new Animation(0.1f, atIncline8_Region);
			break;
		case 9:
			if (direct == 2)
				animationAttack = new Animation(0.1f, atStraight9_Region);
			else
				animationAttack = new Animation(0.1f, atIncline9_Region);
			break;
		}
		return animationAttack;
	}

	public static Animation getAnimationDie(int id) {
		Animation animation = null;
		if (id <= 3)
			animation = new Animation(0.1f, dead1_Region);
		else if (id <= 6)
			animation = new Animation(0.1f, dead4_Region);
		else
			animation = new Animation(0.1f, dead7_Region);
		return animation;
	}

	public static Texture getTexture(String file) {
		Texture texture = LoadingScreen.manager.get(file, Texture.class);
		texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
		return texture;
	}

	public static TextureAtlas getTextureAtlas(String file) {
		return LoadingScreen.manager.get(file, TextureAtlas.class);
	}

	public static Texture loadTexture(String file) {
		Texture texture = new Texture(Gdx.files.internal(file));
		texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
		return texture;
	}

	// Cat cac frame trong 1 texture sau do dua vao mang TextureRegion voi col
	// la so frame trong texture
	// co the cat texture co nhieu hang bang cach them tham so int row thay cho
	// 1 trong vong for: for (int i = 0; i < row; i++)
	private static Array<TextureRegion> splitTexture(Texture texture, int col,
			int width, int height) {
		Array<TextureRegion> arr_Region = new Array<TextureRegion>();
		TextureRegion[][] tmp = TextureRegion.split(texture, width, height);

		// int index = 0;
		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < col; j++) {
				// straight10_Region[index++] = tmp[i][j];
				arr_Region.add(tmp[i][j]);
			}
		}
		return arr_Region;
	}

	// Cat cac frame trong 1 texture sau do dua vao mang TextureRegion
	private static Array<TextureRegion> splitTexture(Texture texture,
			int width, int height) {
		Array<TextureRegion> arr_Region = new Array<TextureRegion>();
		TextureRegion[][] tmp = TextureRegion.split(texture, width, height);

		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 10; j++) {
				arr_Region.add(tmp[i][j]);
			}
		}
		return arr_Region;
	}

	private static Array<TextureRegion> splitTexture3(Texture texture,
			int width, int height) {
		Array<TextureRegion> arr_Region = new Array<TextureRegion>();
		TextureRegion[][] tmp = TextureRegion.split(texture, width, height);

		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 3; j++) {
				arr_Region.add(tmp[i][j]);
			}
		}
		return arr_Region;
	}

	private static Array<TextureRegion> split(TextureRegion texture, int width,
			int height) {

		Array<TextureRegion> arr_Region = new Array<TextureRegion>();

		TextureRegion[][] tmp = texture.split(width, height);

		for (int i = 0; i < 1; i++) {
			for (int j = 0; j < 3; j++) {
				arr_Region.add(tmp[i][j]);
			}
		}
		return arr_Region;
	}

	public static Sound getSound(String file) {
		return LoadingScreen.managerMusic.get(file, Sound.class);
	}

	public static Music getMusic(String file) {
		return LoadingScreen.managerMusic.get(file, Music.class);
	}

	public static int numBoss10, numBoss11;

	public static void numberBoss() {
		switch (map) {
		case 1:
			numBoss10 = 1;
			numBoss11 = 0;
			break;

		case 2:
			numBoss10 = 0;
			numBoss11 = 1;
			break;
		case 3:
			numBoss10 = 1;
			numBoss11 = 0;
			break;
		case 4:
			numBoss10 = 0;
			numBoss11 = 1;
			break;
		case 5:
			numBoss10 = 1;
			numBoss11 = 0;
			break;
		case 6:
			numBoss10 = 0;
			numBoss11 = 1;
			break;
		case 7:
			numBoss10 = 1;
			numBoss11 = 0;
			break;
		case 8:
			numBoss10 = 0;
			numBoss11 = 1;
			break;
		case 9:
			numBoss10 = 1;
			numBoss11 = 0;
			break;
		case 10:
			numBoss10 = 0;
			numBoss11 = 1;
			break;
		}
	}

}
